package com.xbongbong.saas.model;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.saas.domain.entity.CabinetFileEntity;

import java.util.List;
import java.util.Map;

/**
 *
 * @author 魏荣杰
 * @date 2019/6/20 15:37
 * @since v1.0
 * @version v1.0
 */
public interface CabinetFileModel extends IModel<CabinetFileEntity> {
    @Override
    Integer insert(CabinetFileEntity entity) throws XbbException;

    @Override
    Integer update(CabinetFileEntity entity) throws XbbException;

    @Override
    List<CabinetFileEntity> findEntitys(Map<String, Object> param);

    @Override
    Integer getEntitysCount(Map<String, Object> param);

    Integer deleteByKey(Long key, String corpid);

    CabinetFileEntity getByKey(Long key, String corpid);

    void insertBatch(List<CabinetFileEntity> cabinetFileEntityList);

    List<CabinetFileEntity> getCabinetFiles(String corpid, Long dataId, Integer businessType, Integer type, Long refId);

    List<CabinetFileEntity> getCabinetFilesByUserId(String corpid, String userId, Integer businessType);

    Long getAllSizeByCorpid(String corpid);

    Integer deleteBatch(List<Long> idIn, String corpid);

    List<CabinetFileEntity> getCabinetFilesByIdIn(String corpid, List<Long> dataIds, Integer businessType);

    List<Long> getCabinetFileIdsByIdIn(String corpid, List<Long> dataIds, Integer businessType);

    void updateBatch(List<CabinetFileEntity> cabinetFileEntities, String corpid);

    /**
     * 批量插入文件柜照片，用于资金三期脚本迁移
     *
     * @param cabinetFileModelEntitys
     * @return
     */
    int insertBatchAll(List<CabinetFileEntity> cabinetFileModelEntitys);
}
